package com.bjpowernode.commons.utils;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFSheet;

public  class HSSFCellUtils {

    public static String getHSSFCellValueForStr(HSSFCell cell){
        String str = "";
        if (cell.getCellType()== HSSFCell.CELL_TYPE_STRING){
            str = cell.getStringCellValue();
        }else if (cell.getCellType()==HSSFCell.CELL_TYPE_NUMERIC){
            str = cell.getNumericCellValue()+"";
        }else if (cell.getCellType()==HSSFCell.CELL_TYPE_BOOLEAN){
            str = cell.getBooleanCellValue()+"";
        }else if (cell.getCellType()==HSSFCell.CELL_TYPE_FORMULA){
            str = cell.getCellFormula();
        }else {
            str = "";
        }
        return str;
    }
}
